package com.seveneight.baijiesteward.ui.main.presenter;

import android.content.Context;

import com.alibaba.fastjson.JSONObject;
import com.seveneight.baijiesteward.bean.UserConfigBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.main.contract.UserConfigContract;
import com.seveneight.baijiesteward.ui.main.model.UserConfigModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/30.
 */

public class UserConfigPresenter implements UserConfigContract.UserConfigPresenter {

    UserConfigContract.UserConfigView userConfigView;
    UserConfigContract.UserConfigModel userConfigModel;

    public UserConfigPresenter( UserConfigContract.UserConfigView userConfigView){
        this.userConfigView=userConfigView;
        userConfigModel=new UserConfigModel();
    }

    @Override
    public void getUserConfig(Context context, RequestBody object) {
        userConfigModel.getUserConfig(context,object, new MyCallBack<List<UserConfigBean>>() {
            @Override
            public void onSuccess(List<UserConfigBean> userConfigBeans) {
                userConfigView.rebackConfig(userConfigBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
